package org.chen.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.chen.model.ImageInfo;

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ArticleDTO {
    private String id;

    @NotBlank(message = "标题不能为空")
    private String title;

    private String author;

    @NotBlank(message = "内容不能为空")
    private String contentHtml;  // 富文本内容

    private List<String> leadParagraphs;  // 导语

    private String category;  // 分类

    private List<String> tags;  // 标签

    private String thumbnailUrl;  // 缩略图

    private String mainImageUrl;  // 主图

    private String source; // 来源：admin/crawler

    private Integer status; // 状态：0 草稿/1发布/2下架

    private String summary;     // 摘要

    private Boolean isTop; // 是否置顶
    private Integer topOrder;       // 置顶排序权重（数值越大越靠前）
    private Boolean isHot;          // 是否热门
    private Integer hotOrder;       // 热门排序权重
    private Boolean isRecommend;    // 是否推荐
    private Integer recommendOrder; // 推荐排序权重

    private Long viewCount;

    private List<ImageInfo> images;       // 图片信息

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

}
